//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb

namespace ScottPlot.Colormaps;

public class Phase : IColormap
{
    public string Name => "Phase";
    readonly CustomPalette Colormap;
    public Color GetColor(double position) => Colormap.GetColor(position);
    public Phase()
    {
        Color[] colors =
        [
            new( 168, 120, 13 ),
            new( 169, 119, 15 ),
            new( 171, 118, 17 ),
            new( 172, 117, 19 ),
            new( 174, 116, 20 ),
            new( 175, 115, 22 ),
            new( 177, 114, 24 ),
            new( 178, 113, 25 ),
            new( 179, 112, 27 ),
            new( 181, 111, 29 ),
            new( 182, 110, 30 ),
            new( 183, 109, 32 ),
            new( 185, 108, 34 ),
            new( 186, 107, 35 ),
            new( 187, 106, 37 ),
            new( 189, 105, 38 ),
            new( 190, 104, 40 ),
            new( 191, 103, 42 ),
            new( 192, 102, 43 ),
            new( 193, 101, 45 ),
            new( 194, 100, 46 ),
            new( 196, 98, 48 ),
            new( 197, 97, 50 ),
            new( 198, 96, 51 ),
            new( 199, 95, 53 ),
            new( 200, 94, 55 ),
            new( 201, 93, 56 ),
            new( 202, 92, 58 ),
            new( 203, 90, 60 ),
            new( 204, 89, 62 ),
            new( 205, 88, 63 ),
            new( 206, 87, 65 ),
            new( 207, 86, 67 ),
            new( 208, 84, 69 ),
            new( 208, 83, 71 ),
            new( 209, 82, 73 ),
            new( 210, 81, 75 ),
            new( 211, 79, 77 ),
            new( 212, 78, 79 ),
            new( 213, 77, 81 ),
            new( 213, 75, 83 ),
            new( 214, 74, 85 ),
            new( 215, 73, 87 ),
            new( 216, 71, 90 ),
            new( 216, 70, 92 ),
            new( 217, 69, 94 ),
            new( 217, 67, 97 ),
            new( 218, 66, 99 ),
            new( 219, 64, 102 ),
            new( 219, 63, 104 ),
            new( 220, 61, 107 ),
            new( 220, 60, 109 ),
            new( 221, 58, 112 ),
            new( 221, 57, 115 ),
            new( 221, 56, 118 ),
            new( 222, 54, 120 ),
            new( 222, 53, 123 ),
            new( 222, 51, 126 ),
            new( 222, 50, 129 ),
            new( 223, 49, 132 ),
            new( 223, 47, 135 ),
            new( 223, 46, 138 ),
            new( 223, 45, 141 ),
            new( 223, 43, 144 ),
            new( 223, 42, 147 ),
            new( 222, 41, 151 ),
            new( 222, 40, 154 ),
            new( 222, 40, 157 ),
            new( 222, 39, 160 ),
            new( 221, 38, 163 ),
            new( 221, 38, 166 ),
            new( 220, 37, 169 ),
            new( 220, 37, 173 ),
            new( 219, 37, 176 ),
            new( 218, 37, 179 ),
            new( 218, 38, 182 ),
            new( 217, 38, 185 ),
            new( 216, 39, 188 ),
            new( 215, 39, 190 ),
            new( 214, 40, 193 ),
            new( 213, 41, 196 ),
            new( 212, 42, 199 ),
            new( 211, 43, 201 ),
            new( 210, 45, 204 ),
            new( 209, 46, 206 ),
            new( 208, 47, 208 ),
            new( 207, 49, 211 ),
            new( 205, 50, 213 ),
            new( 204, 52, 215 ),
            new( 203, 53, 217 ),
            new( 201, 55, 219 ),
            new( 200, 57, 221 ),
            new( 198, 58, 223 ),
            new( 197, 60, 225 ),
            new( 195, 62, 226 ),
            new( 194, 63, 228 ),
            new( 192, 65, 229 ),
            new( 190, 67, 231 ),
            new( 189, 69, 232 ),
            new( 187, 70, 233 ),
            new( 185, 72, 235 ),
            new( 184, 74, 236 ),
            new( 182, 75, 237 ),
            new( 180, 77, 238 ),
            new( 178, 79, 239 ),
            new( 176, 80, 239 ),
            new( 174, 82, 240 ),
            new( 172, 84, 241 ),
            new( 170, 85, 241 ),
            new( 169, 87, 242 ),
            new( 167, 89, 243 ),
            new( 164, 90, 243 ),
            new( 162, 92, 243 ),
            new( 160, 93, 244 ),
            new( 158, 95, 244 ),
            new( 156, 96, 244 ),
            new( 154, 98, 244 ),
            new( 152, 99, 244 ),
            new( 149, 101, 244 ),
            new( 147, 102, 244 ),
            new( 145, 104, 244 ),
            new( 143, 105, 244 ),
            new( 140, 107, 243 ),
            new( 138, 108, 243 ),
            new( 135, 109, 243 ),
            new( 133, 111, 242 ),
            new( 130, 112, 241 ),
            new( 128, 113, 241 ),
            new( 125, 115, 240 ),
            new( 123, 116, 239 ),
            new( 120, 117, 239 ),
            new( 118, 119, 238 ),
            new( 115, 120, 237 ),
            new( 112, 121, 236 ),
            new( 110, 122, 235 ),
            new( 107, 123, 233 ),
            new( 104, 124, 232 ),
            new( 102, 126, 231 ),
            new( 99, 127, 230 ),
            new( 96, 128, 228 ),
            new( 93, 129, 227 ),
            new( 90, 130, 225 ),
            new( 88, 131, 223 ),
            new( 85, 132, 222 ),
            new( 82, 133, 220 ),
            new( 79, 134, 218 ),
            new( 77, 135, 216 ),
            new( 74, 135, 215 ),
            new( 71, 136, 213 ),
            new( 69, 137, 211 ),
            new( 66, 138, 209 ),
            new( 64, 138, 207 ),
            new( 61, 139, 205 ),
            new( 59, 140, 203 ),
            new( 56, 140, 201 ),
            new( 54, 141, 199 ),
            new( 52, 142, 196 ),
            new( 50, 142, 194 ),
            new( 48, 143, 192 ),
            new( 46, 143, 190 ),
            new( 44, 144, 188 ),
            new( 42, 144, 186 ),
            new( 40, 145, 184 ),
            new( 39, 145, 182 ),
            new( 37, 145, 180 ),
            new( 36, 146, 178 ),
            new( 35, 146, 176 ),
            new( 33, 146, 174 ),
            new( 32, 147, 172 ),
            new( 31, 147, 170 ),
            new( 30, 147, 168 ),
            new( 29, 148, 166 ),
            new( 28, 148, 164 ),
            new( 27, 148, 162 ),
            new( 26, 148, 160 ),
            new( 25, 149, 158 ),
            new( 25, 149, 156 ),
            new( 24, 149, 154 ),
            new( 23, 149, 152 ),
            new( 22, 150, 150 ),
            new( 21, 150, 148 ),
            new( 20, 150, 146 ),
            new( 20, 150, 144 ),
            new( 19, 151, 142 ),
            new( 18, 151, 140 ),
            new( 17, 151, 138 ),
            new( 16, 151, 136 ),
            new( 15, 151, 134 ),
            new( 14, 152, 132 ),
            new( 13, 152, 130 ),
            new( 13, 152, 128 ),
            new( 12, 152, 126 ),
            new( 12, 152, 124 ),
            new( 11, 153, 121 ),
            new( 11, 153, 119 ),
            new( 11, 153, 117 ),
            new( 12, 153, 115 ),
            new( 13, 153, 112 ),
            new( 14, 153, 110 ),
            new( 15, 154, 107 ),
            new( 17, 154, 105 ),
            new( 19, 154, 102 ),
            new( 21, 154, 99 ),
            new( 23, 154, 97 ),
            new( 25, 154, 94 ),
            new( 28, 154, 91 ),
            new( 31, 154, 88 ),
            new( 33, 154, 85 ),
            new( 36, 154, 82 ),
            new( 39, 154, 79 ),
            new( 43, 154, 76 ),
            new( 46, 154, 73 ),
            new( 49, 153, 70 ),
            new( 53, 153, 67 ),
            new( 56, 153, 64 ),
            new( 60, 153, 60 ),
            new( 64, 152, 57 ),
            new( 67, 152, 54 ),
            new( 71, 151, 50 ),
            new( 75, 151, 47 ),
            new( 79, 150, 44 ),
            new( 83, 150, 41 ),
            new( 86, 149, 38 ),
            new( 90, 148, 35 ),
            new( 94, 148, 32 ),
            new( 97, 147, 30 ),
            new( 101, 146, 27 ),
            new( 104, 145, 25 ),
            new( 107, 144, 23 ),
            new( 111, 144, 22 ),
            new( 114, 143, 20 ),
            new( 116, 142, 19 ),
            new( 119, 141, 18 ),
            new( 122, 140, 17 ),
            new( 125, 139, 16 ),
            new( 127, 139, 15 ),
            new( 130, 138, 15 ),
            new( 132, 137, 14 ),
            new( 134, 136, 14 ),
            new( 136, 135, 14 ),
            new( 139, 134, 13 ),
            new( 141, 133, 13 ),
            new( 143, 132, 13 ),
            new( 145, 131, 13 ),
            new( 147, 131, 13 ),
            new( 149, 130, 13 ),
            new( 151, 129, 13 ),
            new( 153, 128, 13 ),
            new( 155, 127, 13 ),
            new( 157, 126, 13 ),
            new( 159, 125, 13 ),
            new( 161, 124, 13 ),
            new( 162, 123, 13 ),
            new( 164, 122, 13 ),
            new( 166, 121, 13 ),
            new( 168, 120, 13 ),
        ];

        Colormap = new CustomPalette(colors);
    }
}

